<template>
  <el-dialog :title="title" :visible="visible" @close="close">
    <el-form
      ref="form"
      :model="entityData"
      :rules="rules"
      label-width="100px"
      label-position="right"
      style="width:90%;margin:0px auto;"
    >
      <!--表单区域 -->
      <el-form-item label="内容" prop="content">
        <el-input v-model="entityData.content" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="日志类型" prop="logType">
        <dictionary-select
          v-model="entityData.logType"
          :code="constant.DICTIONARY_TYPE_CODES.LOG_TYPE"
          class="form-item"
          :readonly="readonly"
        />
      </el-form-item>
      <el-form-item label="请求时间" prop="requestTime">
        <el-date-picker
          v-model="entityData.requestTime"
          value-format="yyyy-MM-dd HH:mm:ss"
          type="datetime"
          align="right"
          unlink-panels
          :readonly="readonly"
        />
      </el-form-item>
      <el-form-item label="请求参数" prop="requestParam">
        <el-input v-model="entityData.requestParam" type="textarea" :rows="2" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="请求路径" prop="requestPath">
        <el-input v-model="entityData.requestPath" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="请求方法" prop="requestMethod">
        <el-input v-model="entityData.requestMethod" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="操作人账号" prop="operatorAccount">
        <el-input v-model="entityData.operatorAccount" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="操作人姓名" prop="operatorName">
        <el-input v-model="entityData.operatorName" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="操作人ip" prop="operatorIp">
        <el-input v-model="entityData.operatorIp" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="是否执行成功" prop="responseCode">
        <dictionary-radio-group
          v-model="entityData.responseCode"
          :code="constant.DICTIONARY_TYPE_CODES.YES_OR_NO"
          class="form-item"
          :readonly="readonly"
        />
      </el-form-item>
      <el-form-item label="响应数据" prop="responseData">
        <el-input v-model="entityData.responseData" type="textarea" :rows="5" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="执行耗时(毫秒)" prop="timeConsuming">
        <el-input v-model="entityData.timeConsuming" :readonly="readonly" />
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button v-show="saveButtonVisible" type="primary" @click="save">保存</el-button>
      <el-button @click="close">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { detailMixin } from '@/mixin/detailMixin'
const MODULE_CODE = 'system'
const ENTITY_TYPE = 'log'
export default {
  name: ENTITY_TYPE + '-detail',
  mixins: [detailMixin],
  data() {
    return {
      entityType: ENTITY_TYPE,
      moduleCode: MODULE_CODE,
      // eslint-disable-next-line no-eval
      api: eval('this.$api.' + MODULE_CODE + '.' + ENTITY_TYPE),
      pageCode: MODULE_CODE + ':' + ENTITY_TYPE + ':',
      entityData: {

      },
      rules: {

      },
      currentRow: {}
    }
  },
  methods: {

  }

}
</script>

<style lang="scss">
</style>
